import request from '@/utils/request'

// 查询订单列表
export function listOrder(query) {
  return request({
    url: '/order/order/list',
    method: 'get',
    params: query
  })
}

// 查询订单列表
export function listStatistics(query) {
  return request({
    url: '/order/order/listStatistics',
    method: 'get',
    params: query
  })
}

// 查询订单详细
export function getOrder(id) {
  return request({
    url: '/order/order/' + id,
    method: 'get'
  })
}

// 新增订单
export function addOrder(data) {
  return request({
    url: '/order/order',
    method: 'post',
    data: data
  })
}

// 复核
export function recheckOrder(data) {
  return request({
    url: '/order/order/recheck',
    method: 'post',
    data: data
  })
}
// 确认
export function confirmOrder(ids) {
  return request({
    url: '/order/order/confirm/' + ids,
    method: 'post'
  })
}

// 保存异常订单
export function saveAbnormalJcOrder(data) {
  return request({
    url: '/order/order/saveAbnormalJcOrder',
    method: 'post',
    data: data
  })
}

// 复制
export function copyOrders(ids) {
  return request({
    url: '/order/order/copyOrders/' + ids,
    method: 'post'
  })
}

// 打印
export function printOrder(ids) {
  return request({
    url: '/order/order/getOrderPrint/' + ids,
    method: 'post'
  })
}


// 修改订单
export function updateOrder(data) {
  return request({
    url: '/order/order',
    method: 'put',
    data: data
  })
}

// 删除订单
export function delOrder(id) {
  return request({
    url: '/order/order/' + id,
    method: 'delete'
  })
}
